﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace DocumentMakingTools.ViewModels
{
    internal class WebViewViewModel : ViewModelBase, IQueryAttributable
    {
        private string url;
        public string Url
        { get => url; set { SetProperty(ref url, value); } }
        Page page;
        public WebViewViewModel(Page page)
        {
            this.page = page;
        }
        public void ApplyQueryAttributes(IDictionary<string, object> query)
        {
            if (query.Count > 0)
            {
                if (query.TryGetValue("url", out object _url))
                {
                    Url = HttpUtility.UrlDecode(_url as string);
                }
            }
        }
    }
}
